Structured documents written in XML, HTML, or other languages used for data exchanges over networks such as the Internet (referred to as structured documents hereafter) may have meta information, such as annotations, that addresses particular elements in the structured documents. The structured documents may also have modification rules written in the documents in advance, under which the documents are modified. To add these meta information and modification rules to the structured documents, XPath (XML Path Language) is often used to address particular positions in the structured documents so that external documents are referred to.
XPath is a language for addressing particular parts of a structured document. Using XPath as addressing information allows arbitrarily specifying those positions in the structured document to which annotations are added or modifications are made. In the subsequent description, data written in XPath will also be simply referred to as an XPath.
Specifically, XPath is written in the following manner. FIG. 18 shows an exemplary structure of an XML document, a type of structured document. A root element is expressed as “/” in XPath. Therefore, for the XML document in FIG. 18, an element a is a child element of a root and expressed as “/a.” Elements b and d are expressed as “/a/b” and “/a/b/d”, respectively. An XPath expression “//p[id=“foo”]”, for example, selects all p elements in an XML document that have “foo” as their id attributes.
As described above, XPath allows arbitrarily addressing particular elements in a structured document such as an XML or HTML/XML document. However, if the structured document subjected to designation is modified, elements or their positions in the document change. Therefore, the position designation in XPath may get out of order, and desired elements may not be properly addressed.
Conventionally, to keep the desired elements properly addressed in the structured document in this case, XPath descriptions have to be modified manually. This requires significant efforts and imposes a heavy burden on a developer of a system involving this structured document.